home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3592 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.2 KB

  1. Path: oxy.rust.net!usenet
  2. From: ebennett@rust.net
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Using templates in BC++ 4.5
  5. Date: Thu, 25 Jan 1996 04:01:21 GMT
  6. Organization: Rust Net - High Speed Internet in Detroit  810-642-2276
  7. Message-ID: <4e6koc$ela@oxy.rust.net>
  8. References: <31050C2D.674C@tribeca.ios.com>
  9. NNTP-Posting-Host: liv-18.rust.net
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. John Leonard <leonardj@tribeca.ios.com> wrote:
  13.  
  14. >I wrote a windows program, in BC++ 4.52, that uses class templates. 
  15. >The template declarations are in a header file and the function 
  16. >definitions are in a cpp file which includes the header file. The cpp 
  17. >file compiled fine, but the project window showed that the code size 
  18. >equaled zero and when I tried to build and link the entire project I got 
  19. >linker error messages that the member functions of the class were 
  20. >undefined. I then changed the code so that the classes weren't templates 
  21. >and the project was built and ran fine. My question is: how can I use 
  22. >class templates in my program?
  23.  
  24. In order to separate the template class declaration from its
  25. implementation, you need to use the -Jg switches.  Check in the
  26. Programmers Guide for information.
  27.  
  28.  
  29. Earl Bennett
  30.  
  31.  
  32.